import React, { Component } from 'react'
import _ from 'lodash'
interface Iprops {
    search:(item:string)=>void
}
interface Istate {
    search:string,
}
export default class Search extends Component<Iprops,Istate> {
    constructor(props:Iprops){
        super(props);
        this.state={
            search:"",
        }
    }
  render() {
    return (
      <>
       搜索<input type="text" onChange={_.debounce((e)=>{this.props.search(e.target.value)},1000)}/>
      </>
    )
  }
}
